package com.douqu.game.core.config.talent;

import com.douqu.game.core.e.E_ValueType;
import com.douqu.game.core.entity.GameObject;
import com.douqu.game.core.util.LoadUtils;

/**
 * @Author: Bean
 * @Description:
 * @Date: 2018-10-11 10:44
 */
public class TalentLibraryConfig extends GameObject {

    public int talentId;

    public int talentLevel;

    public int type;

    public int[] camp;

    public int[] army;

    public int skill;

    public int[] attrId;

    public E_ValueType valueType;

    public int value;

    public int buffId;

    @Override
    public boolean check() {
        return super.check();
    }


    @Override
    public boolean setVariable(String key, String value) {

        if("camp".equals(key))
        {
            camp = LoadUtils.loadIntArray(key, value);
            return true;
        }
        else if("army".equals(key))
        {
            army = LoadUtils.loadIntArray(key, value);
            return true;
        }
        else if("attrId".equals(key))
        {
            attrId = LoadUtils.loadIntArray(key, value);
            return true;
        }
        else if("valueType".equals(key))
        {
            valueType = E_ValueType.forNumber(Integer.parseInt(value));
            return true;
        }
        else
            return super.setVariable(key, value);
    }
}
